<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<script type="text/javascript">
function initLogs()
{
	jgrouse.log.addHandler(new jgrouse.logHandlers.ConsoleLog());
}

jgrouse_config = 
{
	initLogs : initLogs,
	logLevel : 'INFO',
	nologs : true,
	debug : false
}
</script>

<script type="text/javascript" src='../src/jgrouse.js'></script>
<script type="text/javascript" src='../src/log.js'></script>
<script type="text/javascript" src='../src/classloader.js'></script>


<script type="text/javascript">


jgrouse.module(
{
	name:'testModule', 
	requires:['jgrouse.widgets.StaticText', 'jgrouse.util.TaskManager'], 
	imports : ['jgrouse.widgets.StaticText', 'jgrouse.util.TaskManager'],  
	body:function(salt)
	{
		eval(salt);
		jgrouse.testModule = {};
	},
	
	postInit : function(salt)
	{
		eval(salt);
		
		jgrouse.testModule.run = function()
		{
			var widget = new StaticText({}, {color : 'red'}, 'Nifiga!');
			var cont = document.getElementById('zhopa');
			window.w = widget;
			widget.add(cont, document.getElementById('here'));
		}
	}
});

function init()
{
	jgrouse.require('testModule', function()
	{
		jgrouse.testModule.run();
	});
}

function doRun()
{
	var s = document.getElementById('area').value;
	var r = eval(s);
	alert(r);
}

</script>

</head>
<body>
	<div id='zhopa' style='border: thin solid black;'> bla!<div id='here'>to be replaced</div></div>
	<div id='zhopa1'> boo!</div>
	<form >
		<textarea rows="10" cols="80" name="area" id='area'></textarea>
		<input type="button" name="run" value="Run" onclick="doRun()">
	</form>
</body>
<script type="text/javascript">
	init();
</script>
</html>